import { createApp } from "vue";
import pinia from "./stores";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import App from "./App.vue";
import router from "./router";
import "./styles/index.scss";
import ElSvg from "./components/SvgIcon/ElSvg";
import "./permission";
import { myDirective } from "@/directives/permissions";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import myButton from "@/components/myButton/index.vue";
const app = createApp(App);

app.directive("permission", myDirective);
app.component("myButton", myButton);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
ElSvg(app);

// Vue.use(VuePlugin);
app
  .use(pinia)
  .use(router)
  .use(ElementPlus, {
    locale: zhCn,
  })
  .mount("#app");
